// 1、导入axios以及拦截器
import service from './request'

// 2、定义登录函数接口
export const login = (data) => {
    return service({
        url: '/user/loginByBody',
        method: 'post',
        data
    })
};

export const loginByCloud = (data) => {
    return service({
        url: '/user/login',
        method: 'post',
        data
    })
};

export const getBlogsByPage = (data) => {
    return service({
        url: '/blog/list',
        method: 'post',
        data
    })
};

export const deleteBlogById = (data) => {
    return service({
        url: '/blog/del',
        method: 'post',
        data
    })
};

export const addBlog = (data) => {
    return service({
        url: '/blog/add',
        method: 'post',
        data
    })
};

export const getBlogById = (data) => {
    return service({
        url: '/blog/getBlogById',
        method: 'post',
        data
    })
};

export const updateBlogById = (data) => {
    return service({
        url: '/blog/updateBlogById',
        method: 'post',
        data
    })
};

export const searchElasticByKeyword = (data) => {
    return service({
        url: '/blog/getBlogByKeyword',
        method: 'post',
        data
    })
};

export const userList = (data) => {
    return service({
        url: '/user/list',
        method: 'post',
        data
    })
};